<?php
session_start();

if ($_REQUEST['other'] == "simulate error")
{
	echo json_encode(array(
		"error" => true
	));
}
else
{
	$_SESSION['datastore_file'] = $_FILES['newfile']['name'];
	echo json_encode(array(
		"error" => false,
		"new_file" => $_SESSION['datastore_file']
	));
}
?>